﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Demo.Framework.Algorithms.UnionFind
{
    class Program
    {
        static void Main(string[] args)
        {
            // 3-4 5-7 3-6 1-0 0-7 3-2 4-7 7-9 8-3
            WeightedQuickUnion wqu = new WeightedQuickUnion(10);
            wqu.Union(3, 4);
            wqu.Union(5, 7);
            wqu.Union(3, 6);
            wqu.Union(1, 0);
            wqu.Union(0, 7);
            wqu.Union(3, 2);
            wqu.Union(4, 7);
            wqu.Union(7, 9);
            wqu.Union(8, 3);

            Console.WriteLine(wqu.ToString());

            Console.Read();
        }
    }
}
